package com.woniu.command.inventoryCommand;

import com.woniu.command.CommandInteger;
import com.woniu.command.handler.InventoryCommandHandler;
import com.woniu.outlet.po.InventoryPo;
import com.woniu.util.ApplicationContextHolder;

public class ProjectOutCommand implements CommandInteger<InventoryPo> {

    private InventoryCommandHandler handler;

    public ProjectOutCommand(){
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(InventoryCommandHandler.class);
    }

    @Override
    public Integer execute(InventoryPo inventoryPo) {
        return handler.projectOut(inventoryPo.getCode(),inventoryPo.getNum());
    }
}
